package day003;

public class Code09_SerializedTree {

    public static class Node {
        public int value;
        public Node left;
        public Node right;

        public Node(int value) {
            this.value = value;
        }
    }


    public static String serializeByPre(Node head){
        if(head == null){
            return "#_";
        }

        String res = head.value + "_";
        res += serializeByPre(head.left);
        res += serializeByPre(head.right);
        return res;
    }
}
